//
//  KBaseSearchFileDTO.m
//  KutulusLaw
//
//  Created by Mahmood1 on 12/10/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "KBaseSearchFileDTO.h"

@implementation KBaseSearchFileDTO
@synthesize ID =_ID, userID = _userID,name = _name, postDate = _posterDate,
filePDF = _filePDF,
postDateText = _postDateText;

- (id)init {
    self = [super init];
    if (self) {
        self.ID = 0;
		self.userID = 0;
		self.name = @"";
		self.postDate = 0;
		self.filePDF = @"";
		self.postDateText = @"";
		
    }
    return self;
}

- (id)initWithDictionary:(NSDictionary *)dictionary {
    self = [self init];
    if (self) {
        if ([dictionary objectForKey:kKEY_ID]) {
			self.ID = [[dictionary objectForKey:kKEY_ID] integerValue];
		}
		
		if ([dictionary objectForKey:kKEY_USER_ID]) {
			self.userID = [[dictionary objectForKey:kKEY_USER_ID] integerValue];
		}
		
				
		if ([dictionary objectForKey:kKEY_NAME]) {
			self.name = [dictionary objectForKey:kKEY_NAME] ;
		}
		
		if ([dictionary objectForKey:kKEY_POST_DATE]) {
			self.postDate = [[dictionary objectForKey:kKEY_POST_DATE] integerValue];
		}
	
		if ([dictionary objectForKey:kKEY_FILE_PDF]) {
			self.filePDF = [dictionary objectForKey:kKEY_FILE_PDF];
		}
		
	
		
	
		if ([dictionary objectForKey:kKEY_POST_DATE_TEXT]) {
			self.postDateText = [dictionary objectForKey:kKEY_POST_DATE_TEXT];
		}
		

    }
    return self;
}

- (id)copy {
    KBaseSearchFileDTO *searchFileDTO = [[KBaseSearchFileDTO alloc] init ];
    if (searchFileDTO) {
		searchFileDTO.ID = self.ID;
		searchFileDTO.userID = self.userID;
		searchFileDTO.name = [self.name copy];
		searchFileDTO.postDate = self.postDate;
		searchFileDTO.filePDF = [self.filePDF copy];	
		searchFileDTO.postDateText= [self.postDateText copy];		
    }
    return self;
}
@end
